package com.java.comprehensive.design.building_modelling.singleton_pattern;

public class SingletonDemo_4 {
    private SingletonDemo_4() {
    }

    private static volatile SingletonDemo_4 instance;

    public static SingletonDemo_4 getInstance() {
        if (instance == null) {
            synchronized (SingletonDemo_4.class) {
                if (instance == null) {
                    instance = new SingletonDemo_4();
                }
            }
        }
        return instance;
    }
}
